package com.noahplat.user.pojo;

import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.beans.factory.annotation.Value;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 菜单栏
 *
 * @author 李东
 * @version 1.0
 * 2021/2/24 15:39
 **/
@Data
@Table(name = "tb_menu")
public class Menu {

    @Id
    private Long id;

    @Id
    private Long acctid; //用于区分属于哪套系统的菜单

    @NotEmpty(message = "菜单名称不能为空")
    @Length(max = 32, message = "长度不能超过32位")
    private String title; //菜单名称，菜单名称

    @NotEmpty(message = "路由不能为空")
    @Length(max = 128, message = "长度不能超过128位")
    private String url; //url 路由

    @NotEmpty(message = "图标不能为空")
    @Length(max = 100, message = "长度不能超过100位")
    private String active; //选中icon图标

    @NotEmpty(message = "系统类别不能为空")
    @Length(max = 3, message = "长度不能超过3位")
    private String stid; //用于区分属于哪套系统的菜单

    @NotEmpty(message = "图标不能为空")
    @Length(max = 100, message = "长度不能超过100位")
    private String inactive; //未选中icon图标

    @Length(max = 20, message = "长度不能超过20位")
    @NotNull(message = "参数不能为null")
    private Long parentid; //父级菜单ID 父级菜单ID

    @NotNull(message = "参数不能为null")
    @Length(max = 1, message = "长度不能超过1位")
    private String del = "N"; //是否删除 是否删除：Y-已经删除；N-未删除

    @Transient
    private String state = "0";  //关联状态 0.未关联 1.已关联

    @Transient
    private String acctName; //关联账套名称

    @Transient
    private String sysName; //关联系统名称

}
